//
//  PlayingLineView.m
//  ChatForHot
//
//  Created by wr on 2018/10/18.
//  Copyright © 2018年 FLY. All rights reserved.
//

#import "VideoPlayingLineView.h"

@implementation VideoPlayingLineView

- (void)layoutSubviews{
    [super layoutSubviews];
}

- (CALayer *)movelayer{
    if (_movelayer == nil) {
        _movelayer = [CALayer layer];
        [self.layer addSublayer:_movelayer];
    }
    return _movelayer;
}

- (void)setProgress:(float)progress{
    _progress = progress;
    float width = CGRectGetWidth(self.bounds);
    
    float maxwww = progress * width;
    if (maxwww > width) {
        maxwww = width;
    }
    
    self.movelayer.frame = CGRectMake(0, 0, maxwww, CGRectGetHeight(self.bounds));
    
}

- (void)setCaColor:(UIColor *)caColor{
    _caColor = caColor;
    
    self.backgroundColor = [caColor colorWithAlphaComponent:0.3];
    self.movelayer.backgroundColor = caColor.CGColor;
}
@end
